package com.rc.evcharger.service.rc;

import com.rc.evcharger.mapper.rc.RcMemberGainRecordMapper;
import com.rc.evcharger.model.rc.RcMemberGainRecord;
import com.rc.evcharger.model.rc.RcMemberGainRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcMemberGainRecordServiceImpl implements RcMemberGainRecordService {
    @Autowired
    private RcMemberGainRecordMapper rcMemberGainRecordMapper;

    @Override
    public RcMemberGainRecordMapper getMapper() {
        return rcMemberGainRecordMapper;
    }

    @Override
    public List<RcMemberGainRecord> listCurrentByMemberId(Long memberId) {
        RcMemberGainRecordExample example = new RcMemberGainRecordExample();
        example.createCriteria().andMemberIdEqualTo(memberId).andStatusEqualTo("0");
        example.setOrderByClause("created_time desc");
        return rcMemberGainRecordMapper.selectByExample(example);
    }
}
